const crypto = require('crypto');

// 1. 定义密钥
const secret_key = '08A_.Aop/_k'

// 2. 定义加密规则

const md5 = (pwd) => {
  return crypto.createHash('md5').update(pwd).digest('hex');
}

// 3. 定义加密函数
const getPassword = (pwd) => {
  return md5(`pwd=${pwd}&secret_key=${secret_key}`)
}

module.exports = { getPassword };